﻿using UnityEngine;

using System.Collections;



public class MouseMove2D : MonoBehaviour {
	
	
	
	private Vector3 mousePosition;
	
	public float moveSpeed = 0.1f;
	
	
	
	// Use this for initialization
	
	void Start () {
		
	}

	// Update is called once per frame
	
	void Update () {
		//se apertar o botao 1 do mouse
		if (Input.GetMouseButton(1)) {
			//mousePosition recebe a posiçao do click
			mousePosition = Input.mousePosition;
			
			mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
			
			transform.position = Vector2.Lerp(transform.position, mousePosition, moveSpeed);
			
		}
		
		
		
	}
	
}